package com.byxx.gtz.devicemonitoringsysejb.entity;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Region entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "REGION", schema = "DEVICE_FSX")

public class Region implements java.io.Serializable {

	// Fields

	private String regionId;
	private String regionName;
	private String regionFloor;
	private int upperLeftX;
	private int upperLeftY;
	private int lowerRightX;
	private int lowerRightY;
	private String controlMode;
	private String jobPosition;
	private String note;
	private List<DeviceMonitor> deviceMonitors = new ArrayList<DeviceMonitor>();

	// Constructors

	/** default constructor */
	public Region() {
	}

	/** minimal constructor */
	public Region(String regionId) {
		this.regionId = regionId;
	}

	/** full constructor */
	public Region(String regionId, String regionName, String regionFloor, int upperLeftX, int upperLeftY,
			int lowerRightX, int lowerRightY, String controlMode, String jobPosition, String note,
			List<DeviceMonitor> deviceMonitors) {
		this.regionId = regionId;
		this.regionName = regionName;
		this.regionFloor = regionFloor;
		this.upperLeftX = upperLeftX;
		this.upperLeftY = upperLeftY;
		this.lowerRightX = lowerRightX;
		this.lowerRightY = lowerRightY;
		this.controlMode = controlMode;
		this.jobPosition = jobPosition;
		this.note = note;
		this.deviceMonitors = deviceMonitors;
	}

	// Property accessors
	@Id

	@Column(name = "REGION_ID", unique = true, nullable = false, length = 36)

	public String getRegionId() {
		return this.regionId;
	}

	public void setRegionId(String regionId) {
		this.regionId = regionId;
	}

	@Column(name = "REGION_NAME", length = 100)

	public String getRegionName() {
		return this.regionName;
	}

	public void setRegionName(String regionName) {
		this.regionName = regionName;
	}

	@Column(name = "REGION_FLOOR", length = 50)

	public String getRegionFloor() {
		return this.regionFloor;
	}

	public void setRegionFloor(String regionFloor) {
		this.regionFloor = regionFloor;
	}

	@Column(name = "UPPER_LEFT_X", precision = 38, scale = 0)

	public int getUpperLeftX() {
		return this.upperLeftX;
	}

	public void setUpperLeftX(int upperLeftX) {
		this.upperLeftX = upperLeftX;
	}

	@Column(name = "UPPER_LEFT_Y", precision = 38, scale = 0)

	public int getUpperLeftY() {
		return this.upperLeftY;
	}

	public void setUpperLeftY(int upperLeftY) {
		this.upperLeftY = upperLeftY;
	}

	@Column(name = "LOWER_RIGHT_X", precision = 38, scale = 0)

	public int getLowerRightX() {
		return this.lowerRightX;
	}

	public void setLowerRightX(int lowerRightX) {
		this.lowerRightX = lowerRightX;
	}

	@Column(name = "LOWER_RIGHT_Y", precision = 38, scale = 0)

	public int getLowerRightY() {
		return this.lowerRightY;
	}

	public void setLowerRightY(int lowerRightY) {
		this.lowerRightY = lowerRightY;
	}

	@Column(name = "CONTROL_MODE", length = 50)

	public String getControlMode() {
		return this.controlMode;
	}

	public void setControlMode(String controlMode) {
		this.controlMode = controlMode;
	}

	@Column(name = "JOB_POSITION", length = 50)

	public String getJobPosition() {
		return this.jobPosition;
	}

	public void setJobPosition(String jobPosition) {
		this.jobPosition = jobPosition;
	}

	@Column(name = "NOTE", length = 500)

	public String getNote() {
		return this.note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "region")

	public List<DeviceMonitor> getDeviceMonitors() {
		return this.deviceMonitors;
	}

	public void setDeviceMonitors(List<DeviceMonitor> deviceMonitors) {
		this.deviceMonitors = deviceMonitors;
	}

}